The present invention relates to a data recording method and device for recording data such as speed data of a vehicle.
Conventionally, a tachograph is used to record a travel circumstance of a vehicle. The tachograph is designed in such that a vehicle speed, travel distance, engine speed, etc. are recorded in an analog fashion by a recording needle on a circular small recording paper rotating at 360.degree. per 24 hours.
However, the record on the small recording paper obtained by such an analog tachograph should be read manually to require much labor. Furthermore, skill is required for reading of the record, and personal error is generated in reading of the record to cause variations. Moreover, as the totalization of the record obtained should be occasionally carried out by manual calculation, travel control becomes very troublesome.
To solve this problem, it is considered to carry out digital signal processing. However, in the case of recording an instantaneous speed of a vehicle, a memory of a large capacity is required. For instance, assuming that one byte is required for storage of one speed data and that a sampling period for obtaining the instantaneous speed is 0.25 second, an amount of data for 24 hours becomes as follows: ##EQU1## It is impractical to mount a memory having such a large capacity on a vehicle equipment.
To solve this problem, there has been proposed a device for obtaining a permissible error range with respect to data at each sampling timing, obtaining a longest straight line intersecting the permissible error range, and recording a length of the straight line represented by a sampling number and the data at an end point of the straight line.
In the case that the above device is applied to a speedometer of a vehicle, the Japanese Road Traffic Act admits a permissible error range of .+-.10% or less for a vehicle speed of 35 km/h or more in the speedometer. Accordingly, it is sufficient for the digital tachograph to have the same error range. In the above device, the permissible error range with respect to each sampling speed is obtained, and the straight line intersecting the permissible error range is drawn. Accordingly, vehicle speed information in the permissible error range is represented by this straight line. Further, the length of the straight line is recorded as the sampling number, and the data at the end point of the straight line is also recorded, thereby periodically controlling the vehicle speed in a period covered by the straight line. Thus, since the vehicle speed is recorded by only recording the length of the straight line and the end data of the straight line, much information can be stored with a small amount of data, thus realizing data compression.
The data compression processing as mentioned above will now be described with reference to FIG. 17. In FIG. 17, t.sub.0 to t.sub.11 denote sampling timings; V.sub.0 to V.sub.11 denote vehicle speeds at the sampling timings t.sub.0 to t.sub.11, respectively; and a dashed line at each vehicle speed denotes a permissible error range. At each present sampling timing, it is determined whether or not there exists a straight line intersecting the permissible error range of the data at the previous sampling timing. As shown in FIG. 17, it is understood that there exists a straight line intersecting the permissible error range during the period of t.sub.0 to t.sub.9, but the straight line does not intersect the permissible error range at the sampling timing t.sub.10. In this case, a straight line L.sub.1 connecting a start point V.sub.0 and a lower limit of the permissible error range is drawn, and another straight line L.sub.2 connecting the start point V.sub.0 and an upper limit of the permissible error range is also drawn. A middle point V of the range between the straight lines L.sub.1 and L.sub.2 at the sampling timing t.sub.9 is decided as the end data, and the sampling number of "9" is decided as the length of the straight line. In the next stage, the operation similar to the above is carried out. The middle point or end point obtained in the first stage is used as a start point of a straight line to be drawn in the next stage.
In the above compression processing, it is determined whether or not the straight line intersecting the permissible error range at the previous sampling timing also intersects the permissible error range at the present sampling timing. If the straight line intersects the permissible error range at the present sampling timing, the compression processing is continued, while if not, the compression processing is stopped (interrupted). Therefore, there is a possibility that an extended waveform of sampling data after the compression processing is largely deflected from an orginal waveform before the compression processing at inflection points.
FIG. 18 shows a graph of the extended waveform (denoted by a dashed line b) and the original waveform (denoted by a solid line a) of vehicle speed sampled. It is understood from FIG. 18 that the extended waveform is largely deflected from the original waveform at inflection points x.sub.1, x.sub.2 and x.sub.3. In this case, the permissible error range is set to 2 km/h, and the sampling period is set to 0.5 second. Such a phenomenon remarkably appears under a running condition where a rapid speed change is little such as in running on an express highway or automobile road.
Meanwhile, FIG. 19 shows a format of recording the compressed speed data into a recording medium in the prior art. At the beginning of data collection, a start time consisting of year, month, day, hour, minute and second, and an initial speed V.sub.0 are recorded by using total seven bytes as shown by an area a. The initial speed V.sub.0 is used as a start point of a straight line to be drawn for the compression processing of the speed data. Then, as shown by an area b subsequent to the area a, a sampling number representing a length of the straight line is recorded by using one byte, and the compressed speed data is then recorded by using one byte. The subsequent sampling numbers and speed data are similarly recorded after the area b.
As to the single byte to be used for recording the speed data, a leftmost one bit is used for recording a unit distance travel flag. When a vehicle travels a given distance, the unit distance travel flag is set to 1, while in the other cases, it is set to 0. Accordingly, the speed data as a speed (0-127 km/h) at an end point of the straight line is recorded as a binary number by using the remaining seven bits of this byte.
As mentioned above, it is sufficient to record a vehicle speed with an error range of a speedometer admitted by the Japanese Road Traffic Act. Accordingly, it is generally unnecessary to record a fraction part of the vehicle speed. However, in the case that a user desires to reduce a tolerance of the speed data down to .+-.1.5 km/h or .+-.1.0 km/h, for example, a resolution of the speed data must be correspondingly increased up to 1/4 or 1/8, and it becomes necessary to additionally record the fraction part of the speed data.
In the above-mentioned conventional data recording method, however, both a length of the speed data and a length of the sampling number data are fixed. Therefore, in the case that the fraction part of the speed data is intended to be additionally recorded under the condition that only two bytes are used for recording the speed data and the sampling number data, the length of the sampling number data becomes short. For example, when three bits are used for recording the fraction part, a maximum value of the sampling number represented by a binary number becomes 31. Thus, the possibility of data compression is reduced.
If the length of the speed data or the sampling number data is increased, it becomes necessary to always use three bytes for recording the speed data and the sampling number data. Thus, the effect of data compression is largely reduced.